<template>
  <a-affix :offsetTop="85">
    <a-card v-if="anchors.length!==0">
      <h3>目录</h3>
      <a-anchor :showInkInFixed="true" :affix="false" @click="s">
        <a-anchor-link :href="anchor.anchor" :title="anchor.title" v-for="anchor in anchors">
          <a-anchor-link :href="el.anchor" :title="el.title" v-for="el in anchor.child" />
        </a-anchor-link>
      </a-anchor>
    </a-card>
  </a-affix>
</template>

<script setup>
defineProps({
  anchors: {
    type: Array,
    required: true,
    default: []
  }
})

const s = e => {
  console.log(e);
}
</script>

<style scoped>

</style>